package com.itheima.web.servlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.BufferedReader;
import java.io.IOException;

@WebServlet("/trance/*")
public class tranceServelet extends BaseServlet{
    public void madequetion(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        BufferedReader br = request.getReader();
        String params = br.readLine();//json字符串


        //String contextPath = request.getContextPath();
        //response.sendRedirect(contextPath+"/quetion.jsp")
        request.setAttribute("id",params);
        //request.getRequestDispatcher("/survey.jsp").forward(request,response);

        //String contextPath = request.getContextPath();
        //response.sendRedirect(contextPath+"/quetion.jsp");
        //String contextPath = request.getContextPath();
        //response.sendRedirect(contextPath+"/index.jsp");

        //3. 响应成功的标识
        response.getWriter().write("success");

    }
}
